const Group = require('../b/Group')
class GroupMgr {
    constructor () {
        this.groups = new Map()
    }
    static i () {
        if (!this.instance) {
            this.instance = new GroupMgr()
        }
        return this.instance
    }
    create_group (gid) {
        if (this.groups.has(gid)) {
            return this.groups.get(gid)
        }
        let group = new Group(gid)
        this.groups.set('g_' + gid, group)
        return group
    }

}
module.exports = GroupMgr